//
// Created by wze-zero on 2024/8/27 027.
//
#include <iostream>

using namespace std;

int main() {
    long long num1, num2, m, n, temp;
    cin >> num1 >> num2;
    m = num1 > num2 ? num1 : num2;
    n = num1 < num2 ? num1 : num2;
    while (m % n != 0) {
        temp = m % n;
        m = n;
        n = temp;
    }
    m = num1 * num2 / n;
    cout << n + m << endl;
    return 0;
}